'''
@-*- coding: utf-8 -*-
@ python:python 3.9
@ 创建人员:allen
@ 创建时间:2024/8/21
'''

import requests
from fake_useragent import UserAgent
url='http://httpbin.org/get'

headers={'User-Agent':UserAgent().random}

html=requests.get(url=url,headers=headers).text
print(html)
"""
{
  "args": {},
  "headers": {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate",
    "Host": "httpbin.org",
    "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:17.0) Gecko/20100101 Firefox/17.0.6",
    "X-Amzn-Trace-Id": "Root=1-5ff7a4de-05f8d7bf49dfe85e3be31d79"
  },
  "origin": "1.192.244.128",
  "url": "http://httpbin.org/get"
}
"""


